﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



public partial class GiatrifinancialF : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        Label1.Text = Variables.IDDN;
        //ddl_LuaChon.SelectedIndex = 3;
        DatabaseHandler db = new DatabaseHandler();
        db.connect();
        InitializingDatabaseObject ini = new InitializingDatabaseObject(db.loadAllInforByIDDN(Variables.IDDN, "tbl_f"));
        db.close();

        foreach (QuestionObject x in Variables.questionListText)
        {
            if (x != null)
            {
                string id = x.getColumnName().ToString() + "_" + x.getValue().ToString();
                ini.LoadDataToRadioButton(Page.Controls, id);
                ini.LoadDataToTextBox(Page.Controls, x.getColumnName(), x.getValue());
            }
        }
    }



    protected void ddl_LuaChon_SelectedIndexChanged(object sender, EventArgs e)
    {
        Response.Redirect(Redirect.redirectForComboBox(ddl_LuaChon));
    }
    protected void btn_LuuThongTin_Click(object sender, EventArgs e)
    {
        ControlHandler ctHandler = new ControlHandler();
        ctHandler.GetControlList<RadioButton>(Page.Controls, Variables.checkedRadioButtonList);
        ctHandler.GetControlList<TextBox>(Page.Controls, Variables.TextBoxList);
        new AnalysisAndInsert("tbl_f");

        lbShow.Text = "Lưu thông tin doanh nghiệp thành công!";
    }
    protected void btn_redriect_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/GiatriK.aspx");
    }
}